package com.woniuxy.service.impl;

import com.woniuxy.mappers.CategoryMapper;
import com.woniuxy.model.Category;
import com.woniuxy.service.CategoryService;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("")
public class CategoryServiceImpl implements CategoryService {
    private CategoryMapper categoryDao ;

    public void setCategoryDao(CategoryMapper categoryDao) {
        this.categoryDao = categoryDao;
    }

    @Override
    public List<Category> findAllCategories() {
        return categoryDao.findAllCategories();
    }

    @Override
    public int addCategory(Category category) {
        return categoryDao.addCategory(category);
    }

    @Override
    public int deleteCategoryById(Integer id) {
        return categoryDao.deleteCategoryById(id);
    }
}
